year=eval(input())
month=eval(input())
day=eval(input())
list1=[1,3,5,7,8,10,12]
list2=[4,6,9,11]
sum_year=0
sum_month=0
if year>=1970:
    for i in range(1970,year):
        if (i%4==0 and i%100!=0) or (i%400==0):
            sum_year+=366
        else:
            sum_year+=365
    for j in range(1,month):
        if j in list1:
            sum_month+=31
        elif j in list2:
            sum_month+=30
        elif ((year%4==0 and year%100!=0)or(year%400==0)) and j==2:
            sum_month+=29
        else:
            sum_month+=28
    sum_day=day-1
    sum=sum_year+sum_month+sum_day
else:
    for i in range(year+1,1970):
        if (i%4==0 and i%100!=0) or (i%400==0):
            sum_year+=366
        else:
            sum_year+=365
    for j in range(month+1,12+1):
        if j in list1:
            sum_month+=31
        elif j in list2:
            sum_month+=30
        elif ((year%4==0 and year%100!=0)or(year%400==0)) and j==2:
            sum_month+=29
        else:
            sum_month+=28
    if month in list1:
        sum_day=31-day+1
    elif month in list2:
        sum_day=30-day+1
    elif ((year%4==0 and year%100!=0)or(year%400==0)) and month==2:
        sum_day=29-day+1
    else:
        sum_day=28-day+1
    sum=-(sum_year+sum_month+sum_day)
print(sum) 
